package com.infore.statisticsAndAlarm.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.infore.statisticsAndAlarm.entity.FileType;

@Repository
public interface IFileTypeRepository extends JpaRepository<FileType, String>, JpaSpecificationExecutor<FileType> {

	// 通过知识库类型得到文件类型，并按时间排序
	List<FileType> findByKnowledgeTypeOrderByCreateTimeAsc(String knowledgeType);

	// 通过id删除文件分类
	@Modifying
	@Transactional
	int deleteByFileTypeIdIn(List<String> idsList);
}
